package com.zsh.jedis;

import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisCluster;

/**
 * @author zsh
 * @Description
 * @create 2022-04-22 19:06
 */
public class RedisClusterDemo {
    public static void main(String[] args) {
        //创建对象
        HostAndPort hostAndPort = new HostAndPort("192.168.200.128", 6389);
        JedisCluster jedisCluster = new JedisCluster(hostAndPort);

        //进行操作
        jedisCluster.set("b1","val1");

        String s = jedisCluster.get("b1");
        System.out.println(s);

        jedisCluster.close();
    }
}
